﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Shoppinglist.aspx.cs" Inherits="Shoppinglist" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">


    <form runat="server">

        <div class="jumbotron" style="height: 960px">

            <div class="jumbotron" style="width: 40%; padding-bottom: 0px">
                <asp:TextBox ID="searchWord" CssClass="form-control" runat="server" placeholder="Søg på produkt" Style="width: 80%; float: left" />
                <asp:Button ID="searchBtn" runat="server" Text="Søg" CssClass="btn btn-success" Style="float: right" OnClick="DropDownTypes_SelectedIndexChanged" />

            </div>
            <div class="jumbotron" style="width: 40%; padding-bottom: 0">
                <asp:DropDownList ID="DropDownTypes" AutoPostBack="true" runat="server" CssClass="form-control" DataSourceID="ProtypeData" placeholder="Produkt type" AppendDataBoundItems="true" OnSelectedIndexChanged="DropDownTypes_SelectedIndexChanged">
                    <asp:ListItem Text="Type"></asp:ListItem>

                </asp:DropDownList>
            </div>
            <div class="jumbotron" style="width: 100%">
                <div style="width: 50%; padding-top: 0; float: left">

                    <h3>Produktliste</h3>
                    <asp:ListBox ID="Productlist" runat="server" Style="float: left" SelectionMode="Multiple" Width="80%" Rows="30" CssClass="form-control"
                        DataSourceID="ProductDataScource" DataTextField="Name" DataValueField="Id" AppendDataBoundItems="false"></asp:ListBox>
                    <asp:Button ID="MoveRight" Text=">>" runat="server" Width="15%" CssClass="btn-primary btn btn-group-justified" Style="height: 35px; float: right" OnClick="MoveRight_Click" />
                    <asp:Button ID="MoveLeft" Text="<<" runat="server" Width="15%" CssClass="btn-primary btn btn-group-justified" Style="height: 35px; float: right" OnClick="MoveLeft_Click" />
                </div>
                <div style="width: 50%; padding-top: 0; float: right; padding-left: 20px">
                    <h3>Indkøbsliste</h3>
                    <asp:ListBox ID="HiddenShoppingList" runat="server" SelectionMode="Multiple" MultiColumn="true" Width="80%" Rows="10" CssClass="form-control" Visible="true"></asp:ListBox>


                </div>
            </div>
            <asp:ObjectDataSource ID="ProductDataScource" runat="server" SelectMethod="SelectAllProduct" DataObjectTypeName="Id" TypeName="
                WcfBackend.WcfFoodAndAllergiesClient"></asp:ObjectDataSource>
            <asp:ObjectDataSource ID="ProtypeData" runat="server" SelectMethod="GetProductTypes" DataObjectTypeName="Id" TypeName="WcfBackend.WcfFoodAndAllergiesClient"></asp:ObjectDataSource>
        </div>

    </form>
    <script type="text/javascript">

        $("tr").not(':first').click(
          function () {
              if ($(this).hasClass("highlights")) {
                  $(this).removeClass("highlights")
                  $(this).find("label").text("unmarked")
              }
              else {

                  $(this).addClass("highlights");
                  $(this).find("label").text("marked")
              }
          }
        );
    </script>




</asp:Content>

